extends "../../../azurlane_ctrl/Boss.gd"

var baseId = ""
func _extInit():
	._extInit()
	chaName = "「高级塞壬」净化者"   #角色的名称
	attInfox.maxHp = 33333
	attInfox.atk = 300
	attInfox.mgiAtk = 400
	attInfox.def = 150
	attInfox.dod = 50
	attInfox.cd += 0.3
	attInfox.spd += 0.5
	attInfox.atkRan = 8
	lv = 4            #等级的设置
	ename = "jinghuazhe"
	addSkill("每{cd}秒对当前目标造成[雷击*12]的技能伤害，目标周围(九宫格)友军越多，则伤害显著降低", "直拳", "jinghuazhe1", 6)
	addSkill("每{cd}秒对当前目标周围的敌人造成[雷击*3]的技能伤害", "勾拳", "jinghuazhe2", 6)
	addSkill("每{cd}秒随机清除所有敌人的1种增益效果，并赋予2秒<眩晕>", "净化", "jinghuazhe3", 6)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "jinghuazhe1":
		jinghuazhe1()
	if id == "jinghuazhe2":
		jinghuazhe2()
	if id == "jinghuazhe3":
		jinghuazhe3()				

func jinghuazhe1():
	createCustEff(aiCha.position, "eff/shenfa", 9, false, 1.8, Vector2(0, -55))
	yield(reTimer(0.1),"timeout")
	var dmg = att.mgiAtk*12
	var chas = getAroundChas(aiCha.cell, false)
	dmg *= (1 - chas.size() * 0.1)
	azurHurtChara(aiCha, dmg, sys.HurtType.WEAPON, sys.AtkType.SKILL, "直拳")

func jinghuazhe2():
	for i in getAroundChas(aiCha.cell, false):
		azurHurtChara(i, att.mgiAtk*3, sys.HurtType.WEAPON, sys.AtkType.SKILL, "勾拳")

func jinghuazhe3():
	for i in getAllChas(1):
		for j in i.buffs:
			if not j.isNegetive and isWeakBuff(j):
				j.isDel = true
				castBuff(i, buff.b_xuanYun.new(2))
				break

func getItems():
	addItem(sys.newItem(itemData.rndGetEquipEx(itemData.EquipType.DEF)))	
	addItem(sys.newItem(itemData.rndGetEquipEx(itemData.EquipType.DEF)))	
	addItem(sys.newItem(itemData.rndGetEquipEx(itemData.EquipType.AP)))	